package com.kmvc.message.service;

import com.kmvc.message.tools.DownloadFile;

import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;

public class DownloadService extends Service {
Context context=DownloadService.this;
	@Override
	public IBinder onBind(Intent arg0) {
		//  

		return null;
	}

	@SuppressWarnings("deprecation")
	@Override
	public void onStart(Intent intent, int startId) {
		//  
		super.onStart(intent, startId);
		try{
		//Toast.makeText(DownloadService.this, "开启下载服务", Toast.LENGTH_LONG)
		//		.show();		 
		String URL = intent.getStringExtra("URL");
		String PNAME = intent.getStringExtra("PNAME");
		String NAME=intent.getStringExtra("NAME");
		DownloadFile df = new DownloadFile();
		df.DownLoad(URL,PNAME,DownloadService.this,NAME,"/KMVC_MESSAGE"); 
	//	Toast.makeText(DownloadService.this, "开始下载", Toast.LENGTH_LONG)
	//	.show();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		
	}

}
